$('#dg').datagrid({
    url:'search',
    columns:[[
        {field:'lo_us_id',title:'用户ID',width:100},
        {field:'username',title:'用户名称',width:120},
        {field:'lo_processor',title:'平台版本号',width:150},
        {field:'lo_computername',title:'设备序列号',width:200},
        {field:'lo_ip',title:'客户IP',width:120},
        {field:'lo_date',title:'登录时间',width:160},
        {field:'lo_mac',title:'客户MAC地址',width:200},
        {field:'lo_model',title:'设备型号',width:150},
    ]],
    pagination:true,
    toolbar: '#tb',
    pageSize: 50,
    showHeader: true,
    singleSelect: false,
    onLoadSuccess: function (data) {
        var computer = $("input[name='computer']").val();
        if(computer != ''){
            $("#dg").datagrid("mergeEqualCells", ["username", "lo_computername"])
        }
        console.log(data.total)
    }
});

$('#search').click(function() {
    var mintime = $("input[name='mintime']").val();
    var maxtime = $("input[name='maxtime']").val();
    var name = $("input[name='name']").val();
    var computer = $("input[name='computer']").val();
    $('#dg').datagrid('reload', {
        mintime: mintime,
        maxtime: maxtime,
        name: name,
        computer: computer,
    });
});
